/*
 *  * TimerAE.cpp
 *   *
 *    *  Created on: Feb 4, 2010
 *     *      Author: root
 *      */


#include "Timer_AE.h"

/*****************************************************************************/

void timerAE_start (timerAE clock)

{
     clock->elapsed = 0;
        times (&(clock->time_old));
}

/*****************************************************************************/

void timerAE_run (timerAE clock)

{
     times (&(clock->time_old));
}

/*****************************************************************************/

void timerAE_stop (timerAE clock)

{
     times (&(clock->time_new));
        clock->elapsed +=
               ((double) (clock->time_new.tms_utime - clock->time_old.tms_utime)) / 100;
}

/*****************************************************************************/

double timerAE_get (timerAE clock)

{
     return clock->elapsed;
}

/*****************************************************************************/
